package cn.lili.modules.grab.dingdong;

import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.grab.GrabAfterParam;
import cn.lili.modules.grab.dingdong.reps.after.*;
import cn.lili.modules.grab.dingdong.service.DingdongAfterService;
import cn.lili.modules.grab.enums.SourceEnums;
import cn.lili.modules.grab.enums.StatusEnums;
import cn.lili.modules.grab.factory.after.GrabAfterService;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
@Slf4j
public class GrabDingdongAfterServiceImpl implements GrabAfterService {

    @Resource
    private DingdongAfterService dingdongAfterService;

    @Override
    public SourceEnums step() {
        return SourceEnums.DINGDONG_ADJUNCT;
    }

    /**
     * 售后服务列表
     *
     * @param grabParam 参数
     */
    @Override
    public ResultMessage<Object> serviceList(GrabAfterParam grabParam) {
        log.info("企叮当--售后服务列表入参----{}", JSONObject.toJSONString(grabParam));
        List<ServiceListRespose> serviceListResposeList = dingdongAfterService.serviceList(grabParam.getServiceListRequest());
        //其它业务逻辑
        return ResultUtil.data(StatusEnums.STATUS_200.getDes());
    }

    /**
     * 售后服务类型
     *
     * @param grabParam 参数
     */
    @Override
    public ResultMessage<Object> serviceTypeList(GrabAfterParam grabParam) {
        log.info("企叮当--售后服务类型入参----{}", JSONObject.toJSONString(grabParam));
        List<ServiceTypeListRespose> serviceTypeListResposes = dingdongAfterService.serviceTypeList(grabParam.getServiceTypeListRequest());
        //其它业务逻辑
        return ResultUtil.data(StatusEnums.STATUS_200.getDes());
    }

    /**
     * 创建售后服务
     *
     * @param grabParam 参数
     */
    @Override
    public ResultMessage<Object> createService(GrabAfterParam grabParam) {
        log.info("企叮当--创建售后服务入参----{}", JSONObject.toJSONString(grabParam));
        List<CreateServiceRespose> createServiceResposeList = dingdongAfterService.createService(grabParam.getCreateServiceRequest());
        //其它业务逻辑
        return ResultUtil.data(StatusEnums.STATUS_200.getDes());
    }

    /**
     * 售后服务详情
     *
     * @param grabParam 参数
     */
    @Override
    public ResultMessage<Object> serviceDetail(GrabAfterParam grabParam) {
        log.info("企叮当--售后服务详情入参----{}", JSONObject.toJSONString(grabParam));
        List<ServiceDetailRespose> serviceDetailResposeList = dingdongAfterService.serviceDetail(grabParam.getServiceDetailRequest());
        //其它业务逻辑
        return ResultUtil.data(StatusEnums.STATUS_200.getDes());
    }

    /**
     * 取消售后服务
     *
     * @param grabParam 参数
     */
    @Override
    public ResultMessage<Object> serviceCancel(GrabAfterParam grabParam) {
        log.info("企叮当--取消售后服务入参----{}", JSONObject.toJSONString(grabParam));
        List<ServiceCancelRespose> serviceCancelResposeList = dingdongAfterService.serviceCancel(grabParam.getServiceCancelRequest());
        //其它业务逻辑
        return ResultUtil.data(StatusEnums.STATUS_200.getDes());
    }

    /**
     * 上传售后图片
     *
     * @param grabParam 参数
     */
    @Override
    public ResultMessage<Object> uploadResource(GrabAfterParam grabParam) {
        log.info("企叮当--上传售后图片入参----{}", JSONObject.toJSONString(grabParam));
        List<UploadResourceRespose> uploadResourceResposeList = dingdongAfterService.uploadResource(grabParam.getUploadResourceRequest());
        //其它业务逻辑
        return ResultUtil.data(StatusEnums.STATUS_200.getDes());
    }

    /**
     * 售后申请单详情
     *
     * @param grabParam 参数
     */
    @Override
    public ResultMessage<Object> getOrderRefundInfo(GrabAfterParam grabParam) {
        log.info("企叮当--售后申请单详情入参----{}", JSONObject.toJSONString(grabParam));
        List<GetOrderRefundInfoRespose> getOrderRefundInfoResposeList = dingdongAfterService.getOrderRefundInfo(grabParam.getGetOrderRefundInfoRequest());
        //其它业务逻辑
        return ResultUtil.data(StatusEnums.STATUS_200.getDes());
    }
}
